package simple_factory_pattern.v4;

public class OperationFactory {
    public static Operation createOperation(String strOperate) {
        Operation operation = null;
        switch (strOperate) {
            case "+":
                operation = new AddOperation();
                break;
            case "-":
                operation = new SubOperation();
                break;
            case "*":
                operation = new MulOperation();
                break;
            case "/":
                operation = new DivOperation();
                break;
        }
        return operation;
    }
}
